<!-- SPDX-License-Identifier: GPL-3.0-or-later
License: GNU GPLv3 or later. See the license file in the project root for more information.
Copyright © 2021 - present Aleksey Hoffman. All rights reserved.

GAME:
The game was developed by @Aviark13 (https://www.reddit.com/user/Aviark13/)
Inspired by an artwork of Dana Franklin (https://www.reddit.com/user/DoonaDraws)
Copyright © 2021 - present Aviark13, Dana Franklin. All rights reserved.

The game developer granted the developer of this app the permission to use this game as an easter egg in this app.
-->

<!DOCTYPE html>
<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
      Unity WebGL Player | 
      jumpingDinosaurGame | 
      Game was developed by @Aviark13 | 
      Inspired by an artwork of Dana Franklin
    </title>
    <style>
      #loading-screen__container {
        background-color: #37474f;
        width: 100%;
        height: 100%;
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 100;
        font-family: 'Noto Sans';
        pointer-events: none;
        user-select: none;
        text-align: center;
      }

      #loading-screen__title {
        margin-bottom: 12px;
        font-size: 58px;
        font-weight: bold;
        color: #eee;
      }

      #loading-screen__sub-title {
        font-size: 22px;
        color: #bdbdbd;
      }
    </style>
  </head>
  <body style="text-align: center; margin: 0; width: 100vw; height: 100vh;">
     <div id="loading-screen__container">
      <div id="loading-animation__container">
        <div id="loading-screen__title">Jumping Dinosaur game</div>
        <div id="loading-screen__sub-title">Created by @Aviark13</div>
        <div id="loading-screen__sub-title">Inspired by an artwork of Dana Franklin</div>
      </div>
    </div>
    <canvas id="unity-canvas" style="background: #231F20;"></canvas>
    <script src="Build/jumpingDinosaurGame-0.0.3.loader.js"></script>
    <script>
      const canvasNode = document.querySelector("#unity-canvas")
      canvasNode.width = window.innerWidth
      canvasNode.height = window.innerHeight
      window.addEventListener('resize', (event) => {
        canvasNode.width = window.innerWidth
        canvasNode.height = window.innerHeight
      })
      createUnityInstance(canvasNode, {
        dataUrl: "Build/jumpingDinosaurGame-0.0.3.data",
        frameworkUrl: "Build/jumpingDinosaurGame-0.0.3.framework.js",
        codeUrl: "Build/jumpingDinosaurGame-0.0.3.wasm",
        streamingAssetsUrl: "StreamingAssets",
        companyName: "DefaultCompany",
        productName: "jumpingDinosaurGame",
        productVersion: "1.0"
      })
        .then((data) => {
          const fadeOutTimeout = 1000
          const loadingScreenContainerNode = document.querySelector('#loading-screen__container')
          loadingScreenContainerNode.style.transition = `all ${fadeOutTimeout}ms`
          loadingScreenContainerNode.style.opacity = '0'
          setTimeout(() => {
            loadingScreenContainerNode.remove()
          }, fadeOutTimeout)
        })
    </script>
  </body>
</html>
